home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
pcl4w13.zip
/
PCL4WREF.DOC
< prev
next >
Wrap
Text File
|
1996-07-10
|
56KB
|
1,497 lines
Personal Communications Library
For Windows
(PCL4W)
REFERENCE MANUAL
Version 1.3
July 8, 1996
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 1996
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815
Voice : 205-881-4630
FAX : 205|880|0925
BBS : 205-880-9748
email : info@marshallsoft.com
web : www.marshallsoft.com
_______
____|__ | (R)
--+ | +-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
--+--+ | +---------------------
|___|___| MEMBER
PCL4W Reference Manual Page 1
T A B L E
O F
C O N T E N T S
Chapter Page
Table of Contents..................................2
Introduction.......................................3
SioBaud.........................................4
SioBrkSig.......................................4
SioCTS..........................................5
SioDCD..........................................5
SioDone.........................................6
SioDSR..........................................6
SioDTR..........................................7
SioFIFO.........................................7
SioFlow.........................................8
SioGetc.........................................8
SioGetDiv.......................................9
SioGets.........................................9
SioInfo........................................10
SioIRQ.........................................10
SioLine........................................11
SioLoopBack....................................11
SioModem.......................................12
SioParms.......................................12
SioPorts.......................................13
SioPutc........................................13
SioPuts........................................14
SioRead........................................14
SioReset.......................................15
SioRI..........................................15
SioRTS.........................................16
SioRxBuf.......................................16
SioRxClear.....................................17
SioRxQue.......................................17
SioTxBuf.......................................18
SioTxClear.....................................18
SioTxFlush.....................................19
SioTxQue.......................................19
SioUART........................................20
SioUnGetc......................................20
Function Summary..................................21
Error Code Summary................................22
Code Examples.....................................22
PCL4W Reference Manual Page 2
Introduction
This manual lists all of the PCL4W functions in alphabetical order. Every
library function will return a value as follows:
1. Negative values for error conditions. See last page of this manual for
a list of error values and their meanings.
2. Non-negative values when returning data (eg: SioLine).
3. Zero otherwise.
When debugging an application, be sure to test all return values. Use
SioError() (see file SIOERROR.C) to print the associated text for errors.
Example Code Segment
+---------------------------------------------------------------+
| int Code; /* MUST be 'int', not 'char' */ |
| |
| Code = SioFunction( ); /* any PCL4W function */ |
| if(Code<0) |
| {/* error returned */ |
| SioError(Code); /* SioError prints error text */ |
| SioDone(Port); /* always call SioDone last */ |
| exit(1); |
| } |
| /* no errors */ |
| ...your application code... |
| |
+---------------------------------------------------------------+
The program SIMPLE is provided as a straight forward and simple example of
the use of the PCL4W library - at least as straight forward as any Windows
programming can be.
Also look at the TERM program, which is distributed separately from PCL4W as
WTERM12.ZIP. Many PCL4W functions are used somewhere in TERM. Other example
programs will be provided. Look for them on our User Support BBS.
Also note that there are two versions of the library. One version is with
transmitter interrupts disabled and one is with transmitter interrupts
enabled.
Refer to the User's Manual (PCL4W.USR) for additional information.
PCL4W Reference Manual Page 3
+-------------+------------------------------------------------------------+
| SioBaud | Sets the baud rate of the selected port. |
+-------------+------------------------------------------------------------+
Syntax int SioBaud(int Port,int BaudCode)
/* Port: Port selected (COM1 - COM20) */
/* BaudCode: Baud code */
Remarks The SioBaud function sets the baud rate without resetting the
port. It is used to change the baud rate after calling SioReset.
Code Rate Name Code Rate Name
0 300 Baud300 5 9600 Baud9600
1 600 Baud600 6 19200 Baud19200
2 1200 Baud1200 7 38400 Baud38400
3 2400 Baud2400 8 57600 Baud57600
4 4800 Baud4800 9 115200 Baud115200
Returns -4 : No such port. Expect 0 to MaxPort.
-11 : Bad baud rate code. See above code values.
See Also SioReset
+-------------+------------------------------------------------------------+
| SioBrkSig | Asserts, cancels, or detects BREAK signal. |
+-------------+------------------------------------------------------------+
Syntax int SioBrkSig(int Port,char Cmd)
/* Port: Port selected (COM1 thru COM20) */
/* char Cmd: ASSERT, CANCEL, or DETECT */
Remarks The SioBrkSig function controls the BREAK bit in the line status
register. The legal commands are:
ASSERT_BREAK ('A') to assert BREAK
CANCEL_BREAK ('C') to cancel BREAK
DETECT_BREAK ('D') to detect BREAK
ASSERT_BREAK, CANCEL_BREAK, and DETECT_BREAK are d